<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="texttospeech_v1beta1.html">Cloud Text-to-Speech API</a> . <a href="texttospeech_v1beta1.text.html">text</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#synthesize">synthesize(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Synthesizes speech synchronously: receive results after all text input has been processed.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="synthesize">synthesize(body=None, x__xgafv=None)</code>
  <pre>Synthesizes speech synchronously: receive results after all text input has been processed.

Args:
  body: object, The request body.
    The object takes the form of:

{ # The top-level message sent by the client for the `SynthesizeSpeech` method.
  &quot;advancedVoiceOptions&quot;: { # Used for advanced voice options. # Advanced voice options.
    &quot;lowLatencyJourneySynthesis&quot;: True or False, # Only for Journey voices. If false, the synthesis is context aware and has a higher latency.
    &quot;relaxSafetyFilters&quot;: True or False, # Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only supported for accounts linked to Invoiced (Offline) Cloud billing accounts. Otherwise, will return result google.rpc.Code.INVALID_ARGUMENT.
  },
  &quot;audioConfig&quot;: { # Description of audio data to be synthesized. # Required. The configuration of the synthesized audio.
    &quot;audioEncoding&quot;: &quot;A String&quot;, # Required. The format of the audio byte stream.
    &quot;effectsProfileId&quot;: [ # Optional. Input only. An identifier which selects &#x27;audio effects&#x27; profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See [audio profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for current supported profile ids.
      &quot;A String&quot;,
    ],
    &quot;pitch&quot;: 3.14, # Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.
    &quot;sampleRateHertz&quot;: 42, # Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice&#x27;s natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.
    &quot;speakingRate&quot;: 3.14, # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values &lt; 0.25 or &gt; 2.0 will return an error.
    &quot;volumeGainDb&quot;: 3.14, # Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there&#x27;s usually no effective increase in loudness for any value greater than that.
  },
  &quot;enableTimePointing&quot;: [ # Whether and what timepoints are returned in the response.
    &quot;A String&quot;,
  ],
  &quot;input&quot;: { # Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes. # Required. The Synthesizer requires either plain text or SSML as input.
    &quot;customPronunciations&quot;: { # A collection of pronunciation customizations. # Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren&#x27;t supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
      &quot;pronunciations&quot;: [ # The pronunciation customizations are applied.
        { # Pronunciation customization for a phrase.
          &quot;phoneticEncoding&quot;: &quot;A String&quot;, # The phonetic encoding of the phrase.
          &quot;phrase&quot;: &quot;A String&quot;, # The phrase to which the customization is applied. The phrase can be multiple words, such as proper nouns, but shouldn&#x27;t span the length of the sentence.
          &quot;pronunciation&quot;: &quot;A String&quot;, # The pronunciation of the phrase. This must be in the phonetic encoding specified above.
        },
      ],
    },
    &quot;markup&quot;: &quot;A String&quot;, # Markup for HD voices specifically. This field may not be used with any other voices.
    &quot;multiSpeakerMarkup&quot;: { # A collection of turns for multi-speaker synthesis. # The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
      &quot;turns&quot;: [ # Required. Speaker turns.
        { # A multi-speaker turn.
          &quot;speaker&quot;: &quot;A String&quot;, # Required. The speaker of the turn, for example, &#x27;O&#x27; or &#x27;Q&#x27;. Please refer to documentation for available speakers.
          &quot;text&quot;: &quot;A String&quot;, # Required. The text to speak.
        },
      ],
    },
    &quot;prompt&quot;: &quot;A String&quot;, # This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
    &quot;ssml&quot;: &quot;A String&quot;, # The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
    &quot;text&quot;: &quot;A String&quot;, # The raw text to be synthesized.
  },
  &quot;voice&quot;: { # Description of which voice to use for a synthesis request. # Required. The desired voice of the synthesized audio.
    &quot;customVoice&quot;: { # Description of the custom voice to be synthesized. # The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.
      &quot;model&quot;: &quot;A String&quot;, # Required. The name of the AutoML model that synthesizes the custom voice.
      &quot;reportedUsage&quot;: &quot;A String&quot;, # Optional. Deprecated. The usage of the synthesized audio to be reported.
    },
    &quot;languageCode&quot;: &quot;A String&quot;, # Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. &quot;en-US&quot;. This should not include a script tag (e.g. use &quot;cmn-cn&quot; rather than &quot;cmn-Hant-cn&quot;), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn&#x27;t a Canadian voice available), or even a different language, e.g. using &quot;nb&quot; (Norwegian Bokmal) instead of &quot;no&quot; (Norwegian)&quot;.
    &quot;modelName&quot;: &quot;A String&quot;, # Optional. The name of the model. If set, the service will choose the model matching the specified configuration.
    &quot;multiSpeakerVoiceConfig&quot;: { # Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request. # Optional. The configuration for a Gemini multi-speaker text-to-speech setup. Enables the use of two distinct voices in a single synthesis request.
      &quot;speakerVoiceConfigs&quot;: [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
        { # Configuration for a single speaker in a Gemini TTS multi-speaker setup. Enables dialogue between two speakers.
          &quot;speakerAlias&quot;: &quot;A String&quot;, # Required. The speaker alias of the voice. This is the user-chosen speaker name that is used in the multispeaker text input, such as &quot;Speaker1&quot;.
          &quot;speakerId&quot;: &quot;A String&quot;, # Required. The speaker ID of the voice. See https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options for available values.
        },
      ],
    },
    &quot;name&quot;: &quot;A String&quot;, # The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.
    &quot;ssmlGender&quot;: &quot;A String&quot;, # The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.
    &quot;voiceClone&quot;: { # The configuration of Voice Clone feature. # Optional. The configuration for a voice clone. If [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice clone matching the specified configuration.
      &quot;voiceCloningKey&quot;: &quot;A String&quot;, # Required. Created by GenerateVoiceCloningKey.
    },
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The message returned to the client by the `SynthesizeSpeech` method.
  &quot;audioConfig&quot;: { # Description of audio data to be synthesized. # The audio metadata of `audio_content`.
    &quot;audioEncoding&quot;: &quot;A String&quot;, # Required. The format of the audio byte stream.
    &quot;effectsProfileId&quot;: [ # Optional. Input only. An identifier which selects &#x27;audio effects&#x27; profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See [audio profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for current supported profile ids.
      &quot;A String&quot;,
    ],
    &quot;pitch&quot;: 3.14, # Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.
    &quot;sampleRateHertz&quot;: 42, # Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice&#x27;s natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.
    &quot;speakingRate&quot;: 3.14, # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values &lt; 0.25 or &gt; 2.0 will return an error.
    &quot;volumeGainDb&quot;: 3.14, # Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there&#x27;s usually no effective increase in loudness for any value greater than that.
  },
  &quot;audioContent&quot;: &quot;A String&quot;, # The audio data bytes encoded as specified in the request, including the header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). For LINEAR16 audio, we include the WAV header. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.
  &quot;timepoints&quot;: [ # A link between a position in the original request input and a corresponding time in the output audio. It&#x27;s only supported via `` of SSML input.
    { # This contains a mapping between a certain point in the input text and a corresponding time in the output audio.
      &quot;markName&quot;: &quot;A String&quot;, # Timepoint name as received from the client within `` tag.
      &quot;timeSeconds&quot;: 3.14, # Time offset in seconds from the start of the synthesized audio.
    },
  ],
}</pre>
</div>

</body></html>